package com.xgr.wonderful.view;

import com.xgr.wonderful.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

public class AlertDialog  extends Activity{
	
	private TextView mTextView ;
	private Button mBtnCancel ;
	private Button mBtnOk ;
	private int position ;
	private ImageView mImageView ;
	private EditText mEditText ;
	private boolean isEdittextShow ;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.alert_dialog) ;
		mTextView = (TextView)findViewById(R.id.alert_title) ;
		mBtnCancel = (Button)findViewById(R.id.alert_btn_cancel) ;
		mBtnOk = (Button)findViewById(R.id.alert_btn_ok) ;
		mImageView = (ImageView)findViewById(R.id.alert_image) ;
		mEditText = (EditText)findViewById(R.id.alert_edit) ;
		
		String msg = getIntent().getStringExtra("msg") ;
		String title = getIntent().getStringExtra("title") ;
		//是否显示取消标题
		boolean isTitleCancel = getIntent().getBooleanExtra("titleIsCancel", false) ; 
		//是否显示取消按钮
		boolean isCanelBtnShow = getIntent().getBooleanExtra("cancelBtnShow", false) ;
		
		if(msg!=null){
			((TextView)findViewById(R.id.alert_msg)).setText(msg);
		}
		if (title!= null){
			mTextView.setText(title) ;
		}
		if (isTitleCancel){
			mTextView.setVisibility(View.GONE) ;
		}
	}

}
